/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package op;

/**
 *
 * @author Jonatas
 */
public class TarifaPlano implements Comparable<TarifaPlano>{

    private String plano;
    private double tarifa;

    public TarifaPlano(String plano) {
        this.plano = plano;
        this.tarifa = 0.0;
    }

    public TarifaPlano(String plano, double tarifa) {
        this.plano = plano;
        this.tarifa = tarifa;
    }

    public double getTarifa() {
        return tarifa;
    }

    public void setTarifa(double tarifa) {
        this.tarifa = tarifa;
    }

    public String getPlano() {
        return plano;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final TarifaPlano other = (TarifaPlano) obj;
        if ((this.plano == null) ? (other.plano != null) : !this.plano.equals(other.plano)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 71 * hash + (this.plano != null ? this.plano.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return this.plano;
    }

    public int compareTo(TarifaPlano o) {
        return plano.compareTo(o.plano);
    }
}
